home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
graphic
/
tweak16b.zip
/
MISC.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-04
|
502b
|
39 lines
#ifndef _MISC_HPP
#define _MISC_HPP
enum Boolean { FALSE=(0==1), TRUE=(1==1) };
template <class T>
inline void swap(T &a, T &b)
{
T t(a);
a = b;
b = t;
}
template <class T>
inline T min(T a, T b)
{
return (a<b) ? a : b;
}
template <class T>
inline T max(T a, T b)
{
return (a>b) ? a : b;
}
template <class T>
inline T absolute(T a)
{
return (a<0) ? -a : a;
}
template <class T>
inline void sort(T &a, T &b)
{
if (a>b)
swap(a, b);
}
#endif